/*****************************************************************************
*
*  PROJECT:		
*               
*  LICENSE:		
*
*  DEVELOPER:	
*
*****************************************************************************/

#ifndef EONEFFECTSMANAGER_H
#define EONEFFECTSMANAGER_H

#include "EonSkybox.h"
#include "EonCamera.h"
#include "EonModel.h"

#include <cg/cg.h>
#include <cg/cgGL.h>
#include <gl/glut.h>

namespace Eon
{
	class EffectsMgr
	{
		public:

			EffectsMgr::EffectsMgr		( void )				{ };
			EffectsMgr::~EffectsMgr		( void )				{ };

			int	 init									( void );
			void enableRefractiveEnvironmentMapping		( Eon::Skybox skybox, Eon::Camera camera, Eon::Model::modelMD5 model, GLfloat modelTransmittance, GLfloat modelEtaRatio, GLuint decalMapTexture );
			void enableRefractiveEnvironmentMapping		( Eon::Skybox skybox, Eon::Camera camera, Eon::Model::model3DS model, GLfloat modelTransmittance, GLfloat modelEtaRatio, GLuint decalMapTexture );
			void enableChromaticDispersion				( Eon::Skybox skybox, Eon::Camera camera, Eon::Model::modelMD5 model, GLfloat modelEtaRatio, GLfloat modelFresnelBias, GLfloat modelFresnelScale, GLfloat modelFresnelPower );
			void enableChromaticDispersion				( Eon::Skybox skybox, Eon::Camera camera, Eon::Model::model3DS model, GLfloat modelEtaRatio, GLfloat modelFresnelBias, GLfloat modelFresnelScale, GLfloat modelFresnelPower );
			void enableReflectiveEnvironmentMapping		( Eon::Skybox skybox, Eon::Camera camera, Eon::Model::modelMD5 model, GLfloat modelReflectivity, GLuint decalMapTexture );
			void enableReflectiveEnvironmentMapping		( Eon::Skybox skybox, Eon::Camera camera, Eon::Model::model3DS model, GLfloat modelReflectivity, GLuint decalMapTexture );
			void enablePerVertexLighting				( Eon::Camera camera, Eon::Model::modelMD5 model, Eon::Vector3 lightPosition, Eon::Vector3 lightColor, Eon::Vector3 globalAmbient, Eon::Vector3 emissiveLight, Eon::Vector3 ambientLight, Eon::Vector3 diffuseLight, Eon::Vector3 specularLight, GLfloat shininess );
			void enablePerVertexLighting				( Eon::Camera camera, Eon::Model::model3DS model, Eon::Vector3 lightPosition, Eon::Vector3 lightColor, Eon::Vector3 globalAmbient, Eon::Vector3 emissiveLight, Eon::Vector3 ambientLight, Eon::Vector3 diffuseLight, Eon::Vector3 specularLight, GLfloat shininess );
			void enablePerFragmentLighting				( Eon::Camera camera, Eon::Model::modelMD5 model, Eon::Vector3 lightPosition, Eon::Vector3 lightColor, Eon::Vector3 globalAmbient, Eon::Vector3 emissiveLight, Eon::Vector3 ambientLight, Eon::Vector3 diffuseLight, Eon::Vector3 specularLight, GLfloat shininess );
			void enablePerFragmentLighting				( Eon::Camera camera, Eon::Model::model3DS model, Eon::Vector3 lightPosition, Eon::Vector3 lightColor, Eon::Vector3 globalAmbient, Eon::Vector3 emissiveLight, Eon::Vector3 ambientLight, Eon::Vector3 diffuseLight, Eon::Vector3 specularLight, GLfloat shininess );
			void disableShader							( void );
			void destroy								( void );

		private:

			CGcontext cgContext;
			CGprofile cgVertexProfile, cgFragmentProfile;
			CGprogram cgVertexProgramRefractiveEnvironmentMapping, cgFragmentProgramRefractiveEnvironmentMapping;
			CGprogram cgVertexProgramChromaticDispersion, cgFragmentProgramChromaticDispersion;
			CGprogram cgVertexProgramReflectiveEnvironmentMapping, cgFragmentProgramReflectiveEnvironmentMapping;
			CGprogram cgVertexProgramPerVertexLighting, cgFragmentProgramPerVertexLighting;
			CGprogram cgVertexProgramPerFragmentLighting, cgFragmentProgramPerFragmentLighting;
	};
}

#endif // EONEFFECTSMGR_H